<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>LCOV - iris.info - components/impl/genericTPG.cc</title>
  <link rel="stylesheet" type="text/css" href="../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LTP GCOV extension - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
        <tr>
          <td class="headerItem" width="20%">Current&nbsp;view:</td>
          <td class="headerValue" width="80%" colspan=4><a href="../../index.html">directory</a> - <a href="index.html">components/impl</a> - genericTPG.cc</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Test:</td>
          <td class="headerValue" width="80%" colspan=4>iris.info</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Date:</td>
          <td class="headerValue" width="20%">2010-05-24</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Instrumented&nbsp;lines:</td>
          <td class="headerValue" width="20%">241</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Code&nbsp;covered:</td>
          <td class="headerValue" width="20%">85.9 %</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Executed&nbsp;lines:</td>
          <td class="headerValue" width="20%">207</td>
        </tr>
        </table>
      </td>
    </tr>
    <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td><pre class="source">
<span class="lineNum">       1 </span>                : #ifndef _generictpg_cc_INC
<span class="lineNum">       2 </span>                : #define _generictpg_cc_INC
<span class="lineNum">       3 </span>                : 
<span class="lineNum">       4 </span>                : #include &quot;genericTPG.h&quot;
<span class="lineNum">       5 </span>                : #include &quot;../../MemCtrl/constants.h&quot;
<span class="lineNum">       6 </span>                : #include &lt;string.h&gt;
<span class="lineNum">       7 </span>                : 
<span class="lineNum">       8 </span>                : 
<span class="lineNum">       9 </span>                : 
<span class="lineNum">      10 </span>                : extern unsigned int MC_ADDR_BITS;
<span class="lineNum">      11 </span>                : //unsigned int NUM_OF_CONTROLLERS = 8;
<span class="lineNum">      12 </span><span class="lineCov">            336 : GenericTPG::GenericTPG ()</span>
<span class="lineNum">      13 </span>                : {
<span class="lineNum">      14 </span><span class="lineCov">             56 :     name = &quot;GenericTPG&quot;;</span>
<span class="lineNum">      15 </span><span class="lineCov">             56 :     sending = false;</span>
<span class="lineNum">      16 </span>                :     /* Do this in setup with the address or node_ip appended */
<span class="lineNum">      17 </span><span class="lineCov">             56 :     out_filename = &quot;traceOut.tr&quot;;</span>
<span class="lineNum">      18 </span><span class="lineCov">             56 :     last_vc = 0;</span>
<span class="lineNum">      19 </span><span class="lineCov">             56 :     interface_connections.resize(1);    </span>
<span class="lineNum">      20 </span><span class="lineNoCov">              0 : } /* ----- end of function GenericTPG::GenericTPG ----- */</span>
<span class="lineNum">      21 </span>                : 
<span class="lineNum">      22 </span><span class="lineCov">             56 : GenericTPG::~GenericTPG ()</span>
<span class="lineNum">      23 </span>                : {
<span class="lineNum">      24 </span><span class="lineCov">             56 :     out_file.close();</span>
<span class="lineNum">      25 </span><span class="lineCov">             56 :     mshrHandler-&gt;trace_filename.close();</span>
<span class="lineNum">      26 </span><span class="lineCov">             56 :     mshrHandler-&gt;mshr.clear();</span>
<span class="lineNum">      27 </span><span class="lineCov">             56 :     delete mshrHandler;</span>
<span class="lineNum">      28 </span>                : 
<span class="lineNum">      29 </span><span class="lineCov">            112 : } /* ----- end of function GenericTPG::~GenericTPG ----- */</span>
<span class="lineNum">      30 </span>                : 
<span class="lineNum">      31 </span>                : void
<span class="lineNum">      32 </span><span class="lineCov">             56 : GenericTPG::set_trace_filename( string filename )</span>
<span class="lineNum">      33 </span>                : {
<span class="lineNum">      34 </span><span class="lineCov">             56 :     trace_name = filename;</span>
<span class="lineNum">      35 </span><span class="lineCov">             56 :     cout&lt;&lt;&quot;TraceName: &quot;&lt;&lt;trace_name&lt;&lt;endl;</span>
<span class="lineNum">      36 </span><span class="lineCov">             56 : }</span>
<span class="lineNum">      37 </span>                : 
<span class="lineNum">      38 </span>                : void
<span class="lineNum">      39 </span><span class="lineNoCov">              0 : GenericTPG::set_no_vcs ( uint v)</span>
<span class="lineNum">      40 </span>                : {
<span class="lineNum">      41 </span><span class="lineNoCov">              0 :     vcs = v;</span>
<span class="lineNum">      42 </span><span class="lineNoCov">              0 : }</span>
<span class="lineNum">      43 </span>                : 
<span class="lineNum">      44 </span>                : void
<span class="lineNum">      45 </span><span class="lineCov">             56 : GenericTPG::setup (uint n, uint v, uint time)</span>
<span class="lineNum">      46 </span>                : {
<span class="lineNum">      47 </span><span class="lineCov">             56 :     vcs =v;</span>
<span class="lineNum">      48 </span><span class="lineCov">             56 :     no_nodes = n;</span>
<span class="lineNum">      49 </span><span class="lineCov">             56 :     max_sim_time = time;</span>
<span class="lineNum">      50 </span><span class="lineCov">            112 :     address = myId();</span>
<span class="lineNum">      51 </span><span class="lineCov">             56 :     node_ip = address/3;</span>
<span class="lineNum">      52 </span>                :     
<span class="lineNum">      53 </span><span class="lineCov">             56 :     packets = 0;</span>
<span class="lineNum">      54 </span><span class="lineCov">             56 :     packets_in = 0;</span>
<span class="lineNum">      55 </span><span class="lineCov">             56 :     min_pkt_latency = 999999999;</span>
<span class="lineNum">      56 </span><span class="lineCov">             56 :     last_packet_out_cycle = 0;</span>
<span class="lineNum">      57 </span><span class="lineCov">             56 :     fwd_path_delay = 0;</span>
<span class="lineNum">      58 </span><span class="lineCov">             56 :     roundTripLat = 0;</span>
<span class="lineNum">      59 </span>                : 
<span class="lineNum">      60 </span><span class="lineCov">             56 :     ready.resize( vcs );</span>
<span class="lineNum">      61 </span><span class="lineCov">            168 :     ready.insert( ready.begin(), ready.size(), false );</span>
<span class="lineNum">      62 </span><span class="lineCov">            336 :     for(unsigned int i = 0; i &lt; ready.size(); i++)</span>
<span class="lineNum">      63 </span><span class="lineCov">            112 :         ready[i] = false;</span>
<span class="lineNum">      64 </span>                : 
<span class="lineNum">      65 </span>                :     Addr_t addr;
<span class="lineNum">      66 </span>                :     UInt thread_id;
<span class="lineNum">      67 </span>                :     Time time2;
<span class="lineNum">      68 </span>                :     UInt cmd;   
<span class="lineNum">      69 </span>                : 
<span class="lineNum">      70 </span>                : //    InitMSHR();
<span class="lineNum">      71 </span>                : #ifdef USE_MSHR    
<span class="lineNum">      72 </span><span class="lineCov">             56 :     mshrHandler = new MSHR_H(); </span>
<span class="lineNum">      73 </span><span class="lineCov">             56 :     mshrHandler-&gt;id = node_ip;</span>
<span class="lineNum">      74 </span><span class="lineCov">             56 :     mshrHandler-&gt;parent = this; </span>
<span class="lineNum">      75 </span>                : #endif    
<span class="lineNum">      76 </span>                :  //   mc-&gt;stats-&gt;doneOnce[i] = &amp;mshrHandler[i].done; 
<span class="lineNum">      77 </span><span class="lineCov">             56 :     trace_filename = &amp;mshrHandler-&gt;trace_filename; </span>
<span class="lineNum">      78 </span><span class="lineCov">            112 :     mshrHandler-&gt;filename = trace_name.c_str();      </span>
<span class="lineNum">      79 </span>                : 
<span class="lineNum">      80 </span><span class="lineCov">            112 :     trace_filename-&gt;open(trace_name.c_str(),ios::in);</span>
<span class="lineNum">      81 </span><span class="lineCov">            112 :     if(!trace_filename-&gt;is_open())</span>
<span class="lineNum">      82 </span>                :     {
<span class="lineNum">      83 </span><span class="lineNoCov">              0 :         cout &lt;&lt; &quot;Err opening trace &quot; &lt;&lt; trace_name &lt;&lt; endl;</span>
<span class="lineNum">      84 </span><span class="lineNoCov">              0 :         exit(1);</span>
<span class="lineNum">      85 </span>                :     }
<span class="lineNum">      86 </span>                : 
<span class="lineNum">      87 </span>                : #ifdef USE_MSHR
<span class="lineNum">      88 </span><span class="lineCov">            112 :     if (!trace_filename-&gt;eof())</span>
<span class="lineNum">      89 </span>                :     {
<span class="lineNum">      90 </span><span class="lineCov">             56 :         (*trace_filename) &gt;&gt; hex &gt;&gt; addr;</span>
<span class="lineNum">      91 </span><span class="lineCov">             56 :         (*trace_filename) &gt;&gt; thread_id;   </span>
<span class="lineNum">      92 </span><span class="lineCov">             56 :         (*trace_filename) &gt;&gt; dec &gt;&gt; time2;</span>
<span class="lineNum">      93 </span><span class="lineCov">             56 :         (*trace_filename) &gt;&gt; dec &gt;&gt; cmd;</span>
<span class="lineNum">      94 </span>                :         
<span class="lineNum">      95 </span><span class="lineCov">             56 :         Request *req2 = new Request();</span>
<span class="lineNum">      96 </span><span class="lineCov">             56 :         req2-&gt;cmdType = (Command_t)cmd;</span>
<span class="lineNum">      97 </span><span class="lineCov">             56 :         req2-&gt;address = addr;</span>
<span class="lineNum">      98 </span><span class="lineCov">             56 :         req2-&gt;arrivalTime = time2;</span>
<span class="lineNum">      99 </span><span class="lineCov">             56 :         req2-&gt;threadId = node_ip;</span>
<span class="lineNum">     100 </span><span class="lineCov">             56 :         req2-&gt;address = mshrHandler-&gt;GlobalAddrMap(req2-&gt;address,req2-&gt;threadId);</span>
<span class="lineNum">     101 </span>                : 
<span class="lineNum">     102 </span><span class="lineCov">             56 :         IrisEvent *event = new IrisEvent();</span>
<span class="lineNum">     103 </span><span class="lineCov">             56 :         event-&gt;src = this;</span>
<span class="lineNum">     104 </span><span class="lineCov">             56 :         event-&gt;dst = (Component*)(mshrHandler);</span>
<span class="lineNum">     105 </span><span class="lineCov">             56 :         event-&gt;event_data.push_back(req2);   </span>
<span class="lineNum">     106 </span>                : #ifdef DEEP_DEBUG
<span class="lineNum">     107 </span>                :         cout &lt;&lt; dec &lt;&lt; Simulator::Now() &lt;&lt; &quot;: &quot; &lt;&lt; hex &lt;&lt; req2-&gt;address &lt;&lt; &quot;: First Request of each trace to be send to mshrs&quot; &lt;&lt; endl;        
<span class="lineNum">     108 </span>                : #endif
<span class="lineNum">     109 </span><span class="lineCov">             56 :         Simulator::Schedule(time2, &amp;MSHR_H::process_event, (MSHR_H*)event-&gt;dst, event);   </span>
<span class="lineNum">     110 </span>                :     }
<span class="lineNum">     111 </span>                :     /* send ready events for each virtual channel*/
<span class="lineNum">     112 </span>                : #endif
<span class="lineNum">     113 </span>                : 
<span class="lineNum">     114 </span><span class="lineCov">            112 :     for( unsigned int i = 0; i &lt; vcs; i++ )</span>
<span class="lineNum">     115 </span>                :     {
<span class="lineNum">     116 </span><span class="lineCov">             56 :         IrisEvent* event = new IrisEvent();</span>
<span class="lineNum">     117 </span><span class="lineCov">             56 :         event-&gt;type = READY_EVENT;</span>
<span class="lineNum">     118 </span><span class="lineCov">             56 :         event-&gt;vc = 0;</span>
<span class="lineNum">     119 </span><span class="lineCov">             56 :         Simulator::Schedule(Simulator::Now()+1, &amp;NetworkComponent::process_event,this, event);</span>
<span class="lineNum">     120 </span>                : // interface_connections[0], event);
<span class="lineNum">     121 </span>                :     }
<span class="lineNum">     122 </span>                : 
<span class="lineNum">     123 </span>                : 
<span class="lineNum">     124 </span>                :     return ;
<span class="lineNum">     125 </span>                : } /* ----- end of function GenericTPG::setup ----- */
<span class="lineNum">     126 </span>                : 
<span class="lineNum">     127 </span>                : void
<span class="lineNum">     128 </span><span class="lineCov">             56 : GenericTPG::set_output_path( string name)</span>
<span class="lineNum">     129 </span>                : {
<span class="lineNum">     130 </span>                :     // open the output trace file
<span class="lineNum">     131 </span><span class="lineCov">             56 :     stringstream str;</span>
<span class="lineNum">     132 </span><span class="lineCov">            112 :     str &lt;&lt; name &lt;&lt; &quot;/tpg_&quot; &lt;&lt; node_ip &lt;&lt; &quot;_trace_out.tr&quot;;</span>
<span class="lineNum">     133 </span><span class="lineCov">            112 :     out_filename = str.str();</span>
<span class="lineNum">     134 </span><span class="lineCov">            112 :     out_file.open(out_filename.c_str());</span>
<span class="lineNum">     135 </span><span class="lineCov">            112 :     if( !out_file.is_open() )</span>
<span class="lineNum">     136 </span>                :     {
<span class="lineNum">     137 </span><span class="lineNoCov">              0 :         stringstream stream;</span>
<span class="lineNum">     138 </span><span class="lineNoCov">              0 :         stream &lt;&lt; &quot;Could not open output trace file &quot; &lt;&lt; out_filename &lt;&lt; &quot;.\n&quot;;</span>
<span class="lineNum">     139 </span><span class="lineNoCov">              0 :         timed_cout(stream.str());</span>
<span class="lineNum">     140 </span><span class="lineNoCov">              0 :     }</span>
<span class="lineNum">     141 </span><span class="lineCov">             56 : }</span>
<span class="lineNum">     142 </span>                : 
<span class="lineNum">     143 </span>                : void
<span class="lineNum">     144 </span><span class="lineNoCov">              0 : GenericTPG::finish ()</span>
<span class="lineNum">     145 </span>                : {
<span class="lineNum">     146 </span><span class="lineNoCov">              0 :     out_file.close();</span>
<span class="lineNum">     147 </span><span class="lineNoCov">              0 :     trace_filename-&gt;close();</span>
<span class="lineNum">     148 </span>                :     return ;
<span class="lineNum">     149 </span>                : } /* ----- end of function GenericTPG::finish ----- */
<span class="lineNum">     150 </span>                : 
<span class="lineNum">     151 </span>                : void
<span class="lineNum">     152 </span><span class="lineCov">         776190 : GenericTPG::process_event (IrisEvent* e)</span>
<span class="lineNum">     153 </span>                : {
<span class="lineNum">     154 </span><span class="lineCov">         776190 :     switch(e-&gt;type)</span>
<span class="lineNum">     155 </span>                :     {
<span class="lineNum">     156 </span>                :         case NEW_PACKET_EVENT:
<span class="lineNum">     157 </span><span class="lineCov">         148647 :             handle_new_packet_event(e);</span>
<span class="lineNum">     158 </span><span class="lineCov">         148647 :             break;</span>
<span class="lineNum">     159 </span>                :         case OUT_PULL_EVENT:
<span class="lineNum">     160 </span><span class="lineCov">         474411 :             handle_out_pull_event(e);</span>
<span class="lineNum">     161 </span><span class="lineCov">         474411 :             break;</span>
<span class="lineNum">     162 </span>                :         case READY_EVENT:
<span class="lineNum">     163 </span><span class="lineCov">         153132 :             handle_ready_event(e);</span>
<span class="lineNum">     164 </span><span class="lineCov">         153132 :             break;</span>
<span class="lineNum">     165 </span>                :         default:
<span class="lineNum">     166 </span><span class="lineNoCov">              0 :             cout &lt;&lt; &quot;\nTPG: &quot; &lt;&lt; address &lt;&lt; &quot;process_event: UNK event type&quot; &lt;&lt; endl;</span>
<span class="lineNum">     167 </span>                :             break;
<span class="lineNum">     168 </span>                :     }
<span class="lineNum">     169 </span>                :     return ;
<span class="lineNum">     170 </span>                : } /* ----- end of function GenericTPG::process_event ----- */
<span class="lineNum">     171 </span>                : 
<span class="lineNum">     172 </span>                : void
<span class="lineNum">     173 </span><span class="lineCov">         148647 : GenericTPG::handle_new_packet_event ( IrisEvent* e)</span>
<span class="lineNum">     174 </span>                : {
<span class="lineNum">     175 </span>                :     // get the packet data
<span class="lineNum">     176 </span><span class="lineCov">         148647 :     HighLevelPacket* hlp = static_cast&lt; HighLevelPacket* &gt;( e-&gt;event_data.at(0));</span>
<span class="lineNum">     177 </span><span class="lineCov">         148647 :     double lat = Simulator::Now() - hlp-&gt;sent_time;</span>
<span class="lineNum">     178 </span><span class="lineCov">         148647 :     last_packet_out_cycle = Simulator::Now();</span>
<span class="lineNum">     179 </span><span class="lineCov">         148647 :     if( min_pkt_latency &gt; lat)</span>
<span class="lineNum">     180 </span><span class="lineCov">            197 :         min_pkt_latency = lat;</span>
<span class="lineNum">     181 </span><span class="lineCov">         148647 :     packets_in++;</span>
<span class="lineNum">     182 </span>                : #ifdef DEBUG
<span class="lineNum">     183 </span>                :     _DBG( &quot;-------------- GOT NEW PACKET ---------------\n pkt_latency: %f&quot;, lat);
<span class="lineNum">     184 </span>                :     // write out the packet data to the output trace file
<span class="lineNum">     185 </span>                :     if( !out_file.is_open() )
<span class="lineNum">     186 </span>                :         out_file.open( out_filename.c_str(), std::ios_base::app );
<span class="lineNum">     187 </span>                : 
<span class="lineNum">     188 </span>                :     if( !out_file.is_open() )
<span class="lineNum">     189 </span>                :     {
<span class="lineNum">     190 </span>                :         cout &lt;&lt; &quot;Could not open output trace file &quot; &lt;&lt; out_filename &lt;&lt; &quot;.\n&quot;;
<span class="lineNum">     191 </span>                :     }
<span class="lineNum">     192 </span>                :         
<span class="lineNum">     193 </span>                :         out_file &lt;&lt; hlp-&gt;toString();
<span class="lineNum">     194 </span>                :         out_file &lt;&lt; &quot;\tPkt latency: &quot; &lt;&lt; lat &lt;&lt; endl;
<span class="lineNum">     195 </span>                : #endif
<span class="lineNum">     196 </span>                : 
<span class="lineNum">     197 </span>                : #ifdef USE_MSHR
<span class="lineNum">     198 </span><span class="lineCov">         148647 :     Request * req = new Request();</span>
<span class="lineNum">     199 </span><span class="lineCov">         148647 :     convertFromBitStream(req,hlp);              </span>
<span class="lineNum">     200 </span><span class="lineCov">         148647 :     IrisEvent *event = new IrisEvent();</span>
<span class="lineNum">     201 </span><span class="lineCov">         148647 :     event-&gt;src = (Component*)this;</span>
<span class="lineNum">     202 </span><span class="lineCov">         148647 :     event-&gt;dst = (Component*)mshrHandler;</span>
<span class="lineNum">     203 </span><span class="lineCov">         148647 :     event-&gt;type = MSHR_DELETE;       </span>
<span class="lineNum">     204 </span><span class="lineCov">         148647 :     event-&gt;event_data.push_back(req);        </span>
<span class="lineNum">     205 </span>                : #ifdef _DEEP_DEBUG
<span class="lineNum">     206 </span>                :         cout &lt;&lt; dec &lt;&lt; Simulator::Now() &lt;&lt; &quot;: &quot; &lt;&lt; hex &lt;&lt; req-&gt;address &lt;&lt; &quot;: Sending to MSHR for Delete&quot; &lt;&lt; endl;      
<span class="lineNum">     207 </span>                : #endif
<span class="lineNum">     208 </span><span class="lineCov">         148647 :     Simulator::Schedule(Simulator::Now()+1, &amp;MSHR_H::process_event, (MSHR_H*)event-&gt;dst, event);         </span>
<span class="lineNum">     209 </span>                : #endif
<span class="lineNum">     210 </span>                : 
<span class="lineNum">     211 </span><span class="lineCov">         148647 :     delete hlp;</span>
<span class="lineNum">     212 </span>                : 
<span class="lineNum">     213 </span>                :     // send back a ready event
<span class="lineNum">     214 </span><span class="lineCov">         148647 :     IrisEvent* event2 = new IrisEvent();</span>
<span class="lineNum">     215 </span><span class="lineCov">         148647 :     event2-&gt;type = READY_EVENT;</span>
<span class="lineNum">     216 </span><span class="lineCov">         148647 :     event2-&gt;vc = 0; //hlp-&gt;virtual_channel;</span>
<span class="lineNum">     217 </span><span class="lineCov">         297294 :     Simulator::Schedule( Simulator::Now()+1, &amp;NetworkComponent::process_event, interface_connections[0], event2);</span>
<span class="lineNum">     218 </span>                : 
<span class="lineNum">     219 </span><span class="lineCov">         148647 :     delete e;</span>
<span class="lineNum">     220 </span>                :     return ;
<span class="lineNum">     221 </span>                : } /* ----- end of function GenericTPG::handle_new_packet_event ----- */
<span class="lineNum">     222 </span>                : 
<span class="lineNum">     223 </span>                : void
<span class="lineNum">     224 </span><span class="lineCov">         474411 : GenericTPG::handle_out_pull_event ( IrisEvent* e )</span>
<span class="lineNum">     225 </span>                : {
<span class="lineNum">     226 </span><span class="lineCov">         474411 :     sending =false;</span>
<span class="lineNum">     227 </span><span class="lineCov">         948822 :     if( ready[0] )</span>
<span class="lineNum">     228 </span>                :     {
<span class="lineNum">     229 </span>                : #ifdef USE_MSHR
<span class="lineNum">     230 </span><span class="lineCov">         294337 :     Request* next_req = GetRequest();</span>
<span class="lineNum">     231 </span>                : #else
<span class="lineNum">     232 </span>                :     Request* next_req = GetNextRequest();
<span class="lineNum">     233 </span>                : #endif
<span class="lineNum">     234 </span>                :     MTRand mtrand1;
<span class="lineNum">     235 </span><span class="lineCov">         294337 :     if( next_req)</span>
<span class="lineNum">     236 </span>                :     {
<span class="lineNum">     237 </span><span class="lineCov">         153083 :         packets++;</span>
<span class="lineNum">     238 </span><span class="lineCov">         153083 :         fwd_path_delay = Simulator::Now() - next_req-&gt;arrivalTime;</span>
<span class="lineNum">     239 </span><span class="lineCov">         153083 :         HighLevelPacket* hlp = new HighLevelPacket();</span>
<span class="lineNum">     240 </span><span class="lineCov">         153083 :         hlp-&gt;virtual_channel = 0;</span>
<span class="lineNum">     241 </span><span class="lineCov">         153083 :         hlp-&gt;source = address;</span>
<span class="lineNum">     242 </span>                : //        uint rand_destination = mtrand1.randInt(no_mcs-1); //MIN( generator.address(), MAX_ADDRESS);
<span class="lineNum">     243 </span><span class="lineCov">         153083 :         Addr_t tempAddr = next_req-&gt;address;</span>
<span class="lineNum">     244 </span><span class="lineCov">         153083 :         uint destination=map_addr(&amp;next_req-&gt;address);</span>
<span class="lineNum">     245 </span><span class="lineCov">         153083 :         mshrHandler-&gt;demap_addr(tempAddr,next_req-&gt;address);</span>
<span class="lineNum">     246 </span><span class="lineCov">         306166 :         hlp-&gt;destination = mc_node_ip[destination];</span>
<span class="lineNum">     247 </span><span class="lineCov">         153083 :         hlp-&gt;addr = next_req-&gt;address;</span>
<span class="lineNum">     248 </span>                : 
<span class="lineNum">     249 </span><span class="lineCov">         153083 :         assert ( hlp-&gt;destination &lt; no_nodes);</span>
<span class="lineNum">     250 </span>                : #ifdef DEEP_DEBUG
<span class="lineNum">     251 </span>                :         cout &lt;&lt; endl &lt;&lt; dec &lt;&lt; node_ip &lt;&lt; &quot; ^^Sending to &quot; &lt;&lt; hlp-&gt;destination &lt;&lt; endl;
<span class="lineNum">     252 </span>                : #endif
<span class="lineNum">     253 </span><span class="lineCov">         153083 :         hlp-&gt;transaction_id = mtrand1.randInt(1000);</span>
<span class="lineNum">     254 </span><span class="lineCov">         153083 :         if( hlp-&gt;destination == node_ip )</span>
<span class="lineNum">     255 </span><span class="lineNoCov">              0 :             hlp-&gt;destination = 3; //(hlp-&gt;destination + 1) % max_nodes;</span>
<span class="lineNum">     256 </span>                : 
<span class="lineNum">     257 </span><span class="lineCov">         153083 :         convertToBitStream(next_req, hlp);</span>
<span class="lineNum">     258 </span><span class="lineCov">         153083 :         if(hlp-&gt;sent_time &lt; Simulator::Now())</span>
<span class="lineNum">     259 </span><span class="lineCov">         153054 :             hlp-&gt;sent_time = Simulator::Now();</span>
<span class="lineNum">     260 </span>                : 
<span class="lineNum">     261 </span>                : #ifdef _DEEP_DEBUG
<span class="lineNum">     262 </span>                :         _DBG( &quot; Sending pkt: no of packets %d &quot;, packets );
<span class="lineNum">     263 </span>                :         cout &lt;&lt; &quot;HLP: &quot; &lt;&lt; hlp-&gt;toString() &lt;&lt; endl;
<span class="lineNum">     264 </span>                : #endif
<span class="lineNum">     265 </span><span class="lineCov">         153083 :         ready[0] = false;</span>
<span class="lineNum">     266 </span><span class="lineCov">         153083 :         IrisEvent* event = new IrisEvent();</span>
<span class="lineNum">     267 </span><span class="lineCov">         153083 :         event-&gt;type = NEW_PACKET_EVENT;</span>
<span class="lineNum">     268 </span><span class="lineCov">         153083 :         event-&gt;event_data.push_back(hlp);</span>
<span class="lineNum">     269 </span><span class="lineCov">         306166 :         Simulator::Schedule( hlp-&gt;sent_time, &amp;NetworkComponent::process_event, interface_connections[0], event );</span>
<span class="lineNum">     270 </span><span class="lineCov">         153083 :         sending = true;</span>
<span class="lineNum">     271 </span><span class="lineCov">         153083 :         delete next_req;</span>
<span class="lineNum">     272 </span>                :                 
<span class="lineNum">     273 </span>                :     }
<span class="lineNum">     274 </span>                :     }
<span class="lineNum">     275 </span>                : 
<span class="lineNum">     276 </span><span class="lineCov">         474411 :     if( sending)</span>
<span class="lineNum">     277 </span>                :     {
<span class="lineNum">     278 </span><span class="lineCov">         153083 :         IrisEvent* event2 = new IrisEvent();</span>
<span class="lineNum">     279 </span><span class="lineCov">         153083 :         event2-&gt;type = OUT_PULL_EVENT;</span>
<span class="lineNum">     280 </span><span class="lineCov">         153083 :         event2-&gt;vc = 0; //e-&gt;vc;</span>
<span class="lineNum">     281 </span><span class="lineCov">         153083 :         Simulator::Schedule(Simulator::Now()+1, &amp;NetworkComponent::process_event, this, event2);</span>
<span class="lineNum">     282 </span><span class="lineCov">         153083 :         sending = true;</span>
<span class="lineNum">     283 </span>                :     }           
<span class="lineNum">     284 </span><span class="lineCov">         474411 :    delete e; </span>
<span class="lineNum">     285 </span><span class="lineCov">         474411 : }</span>
<span class="lineNum">     286 </span>                : 
<span class="lineNum">     287 </span>                : void
<span class="lineNum">     288 </span><span class="lineCov">         153132 : GenericTPG::handle_ready_event ( IrisEvent* e)</span>
<span class="lineNum">     289 </span>                : {
<span class="lineNum">     290 </span>                : 
<span class="lineNum">     291 </span>                :     // send the next packet if it is less than the current time
<span class="lineNum">     292 </span><span class="lineCov">         153132 :     ready[0] = true;</span>
<span class="lineNum">     293 </span><span class="lineCov">         153132 :     if( !sending &amp;&amp; Simulator::Now() &lt; max_sim_time )</span>
<span class="lineNum">     294 </span>                :     {
<span class="lineNum">     295 </span><span class="lineCov">         153132 :         IrisEvent* event = new IrisEvent();</span>
<span class="lineNum">     296 </span><span class="lineCov">         153132 :         event-&gt;type = OUT_PULL_EVENT;</span>
<span class="lineNum">     297 </span><span class="lineCov">         153132 :         event-&gt;vc = 0; </span>
<span class="lineNum">     298 </span><span class="lineCov">         153132 :         Simulator::Schedule(Simulator::Now()+1, &amp;NetworkComponent::process_event, this, event);</span>
<span class="lineNum">     299 </span><span class="lineCov">         153132 :         sending = true;</span>
<span class="lineNum">     300 </span>                :     }
<span class="lineNum">     301 </span>                : 
<span class="lineNum">     302 </span><span class="lineCov">         153132 :     delete e;</span>
<span class="lineNum">     303 </span>                :     return ;
<span class="lineNum">     304 </span>                : } /* ----- end of function GenericTPG::handle_ready_event ----- */
<span class="lineNum">     305 </span>                : Request*
<span class="lineNum">     306 </span><span class="lineNoCov">              0 : GenericTPG::GetNextRequest()</span>
<span class="lineNum">     307 </span>                : {
<span class="lineNum">     308 </span><span class="lineNoCov">              0 :     Addr_t addr =0;</span>
<span class="lineNum">     309 </span><span class="lineNoCov">              0 :     UInt thread_id = 0;</span>
<span class="lineNum">     310 </span><span class="lineNoCov">              0 :     Time time = 0;</span>
<span class="lineNum">     311 </span>                :     UInt cmd;
<span class="lineNum">     312 </span>                : 
<span class="lineNum">     313 </span><span class="lineNoCov">              0 :     if (trace_filename-&gt;eof())</span>
<span class="lineNum">     314 </span><span class="lineNoCov">              0 :        return NULL;</span>
<span class="lineNum">     315 </span>                : 
<span class="lineNum">     316 </span>                :     else
<span class="lineNum">     317 </span>                :     {
<span class="lineNum">     318 </span><span class="lineNoCov">              0 :         Request* tempRequest = new Request();</span>
<span class="lineNum">     319 </span><span class="lineNoCov">              0 :         (*trace_filename) &gt;&gt; hex &gt;&gt; addr;</span>
<span class="lineNum">     320 </span><span class="lineNoCov">              0 :         (*trace_filename) &gt;&gt; thread_id;</span>
<span class="lineNum">     321 </span><span class="lineNoCov">              0 :         (*trace_filename) &gt;&gt;dec&gt;&gt; time;</span>
<span class="lineNum">     322 </span><span class="lineNoCov">              0 :         (*trace_filename) &gt;&gt;dec&gt;&gt; cmd;</span>
<span class="lineNum">     323 </span>                : 
<span class="lineNum">     324 </span><span class="lineNoCov">              0 :         tempRequest-&gt;cmdType = (Command_t)cmd;</span>
<span class="lineNum">     325 </span><span class="lineNoCov">              0 :         tempRequest-&gt;address = addr;</span>
<span class="lineNum">     326 </span><span class="lineNoCov">              0 :         tempRequest-&gt;arrivalTime = time;     </span>
<span class="lineNum">     327 </span><span class="lineNoCov">              0 :         tempRequest-&gt;threadId = node_ip;</span>
<span class="lineNum">     328 </span><span class="lineNoCov">              0 :         tempRequest-&gt;address = mshrHandler-&gt;GlobalAddrMap(tempRequest-&gt;address,tempRequest-&gt;threadId);</span>
<span class="lineNum">     329 </span>                : #ifdef _DEEP_DEBUG
<span class="lineNum">     330 </span>                :         cout &lt;&lt; &quot;\n Created Req: &quot;
<span class="lineNum">     331 </span>                :             &lt;&lt; &quot;\t cmd: &quot; &lt;&lt; cmd
<span class="lineNum">     332 </span>                :             &lt;&lt; &quot;\t thr_id: &quot; &lt;&lt; thread_id
<span class="lineNum">     333 </span>                :             &lt;&lt; &quot;\t time: &quot; &lt;&lt; time
<span class="lineNum">     334 </span>                :             &lt;&lt; &quot;\t addr: &quot; &lt;&lt; addr
<span class="lineNum">     335 </span>                :             &lt;&lt; endl;
<span class="lineNum">     336 </span>                : #endif
<span class="lineNum">     337 </span>                : 
<span class="lineNum">     338 </span><span class="lineNoCov">              0 :         return tempRequest;</span>
<span class="lineNum">     339 </span>                :     }
<span class="lineNum">     340 </span>                :     
<span class="lineNum">     341 </span>                : }
<span class="lineNum">     342 </span>                : 
<span class="lineNum">     343 </span>                : bool
<span class="lineNum">     344 </span><span class="lineCov">         294337 : GenericTPG::GetNewRequest(Request *req)</span>
<span class="lineNum">     345 </span>                : {
<span class="lineNum">     346 </span><span class="lineCov">         588674 :     if (!mshrHandler-&gt;writeQueue.empty())</span>
<span class="lineNum">     347 </span>                :     {
<span class="lineNum">     348 </span><span class="lineCov">           8468 :         if (mshrHandler-&gt;writeQueue[0].arrivalTime &lt;= Simulator::Now())</span>
<span class="lineNum">     349 </span>                :         {
<span class="lineNum">     350 </span><span class="lineCov">           4234 :             vector&lt;Request&gt;::iterator bufferIndex = mshrHandler-&gt;writeQueue.begin();</span>
<span class="lineNum">     351 </span><span class="lineCov">           8468 :             *req = mshrHandler-&gt;writeQueue[0];</span>
<span class="lineNum">     352 </span><span class="lineCov">           4234 :             req-&gt;startTime = Simulator::Now();       </span>
<span class="lineNum">     353 </span><span class="lineCov">           4234 :             mshrHandler-&gt;writeQueue.erase(bufferIndex);</span>
<span class="lineNum">     354 </span><span class="lineCov">           4234 :             return true;</span>
<span class="lineNum">     355 </span>                :         }
<span class="lineNum">     356 </span>                :     }
<span class="lineNum">     357 </span><span class="lineCov">         868882 :     else  if (!mshrHandler-&gt;mshr.empty() &amp;&amp; mshrHandler-&gt;lastScheduledIndex &lt; mshrHandler-&gt;mshr.size())</span>
<span class="lineNum">     358 </span>                :     {
<span class="lineNum">     359 </span><span class="lineCov">         297698 :         if (mshrHandler-&gt;mshr[mshrHandler-&gt;lastScheduledIndex].arrivalTime &lt;= Simulator::Now())</span>
<span class="lineNum">     360 </span>                :         {
<span class="lineNum">     361 </span><span class="lineCov">         297698 :             *req = mshrHandler-&gt;mshr[mshrHandler-&gt;lastScheduledIndex];</span>
<span class="lineNum">     362 </span><span class="lineCov">         148849 :         mshrHandler-&gt;lastScheduledIndex++;</span>
<span class="lineNum">     363 </span><span class="lineCov">         148849 :             return true;</span>
<span class="lineNum">     364 </span>                :         }
<span class="lineNum">     365 </span>                :     }
<span class="lineNum">     366 </span><span class="lineCov">         282508 :     if (mshrHandler-&gt;lastScheduledIndex &gt; mshrHandler-&gt;mshr.size())</span>
<span class="lineNum">     367 </span>                :     {
<span class="lineNum">     368 </span><span class="lineNoCov">              0 :         cout &lt;&lt; &quot;\nERROR: lastIndex greater&quot; &lt;&lt; mshrHandler-&gt;lastScheduledIndex &lt;&lt; &quot; &quot; &lt;&lt; mshrHandler-&gt;mshr.size() &lt;&lt; endl;</span>
<span class="lineNum">     369 </span><span class="lineNoCov">              0 :         exit(1);</span>
<span class="lineNum">     370 </span>                :     }
<span class="lineNum">     371 </span><span class="lineCov">         141254 :     return false;</span>
<span class="lineNum">     372 </span>                : }
<span class="lineNum">     373 </span>                : 
<span class="lineNum">     374 </span>                : Request*
<span class="lineNum">     375 </span><span class="lineCov">         294337 : GenericTPG::GetRequest()</span>
<span class="lineNum">     376 </span>                : {
<span class="lineNum">     377 </span><span class="lineCov">         294337 :     Request* req = new Request();</span>
<span class="lineNum">     378 </span><span class="lineCov">         294337 :     if (GetNewRequest(req))</span>
<span class="lineNum">     379 </span>                :     {
<span class="lineNum">     380 </span><span class="lineCov">         153083 :         return req;</span>
<span class="lineNum">     381 </span>                :     }
<span class="lineNum">     382 </span><span class="lineCov">         141254 :     delete req;</span>
<span class="lineNum">     383 </span><span class="lineCov">         141254 :     return NULL;</span>
<span class="lineNum">     384 </span>                : }
<span class="lineNum">     385 </span>                : 
<span class="lineNum">     386 </span>                : void
<span class="lineNum">     387 </span><span class="lineCov">         153083 : GenericTPG::convertToBitStream(Request* req, HighLevelPacket* hlp)</span>
<span class="lineNum">     388 </span>                : {
<span class="lineNum">     389 </span><span class="lineCov">        5051739 :     for ( uint i=0 ; i &lt; NETWORK_ADDRESS_BITS ; i++ )</span>
<span class="lineNum">     390 </span>                :     {
<span class="lineNum">     391 </span><span class="lineCov">        4898656 :         bool bit = (bool)((req-&gt;address &gt;&gt; i) &amp; 0x1);</span>
<span class="lineNum">     392 </span><span class="lineCov">        4898656 :         hlp-&gt;data.push_back(bit);</span>
<span class="lineNum">     393 </span>                :     }
<span class="lineNum">     394 </span><span class="lineCov">         612332 :     for ( uint i=0 ; i &lt; NETWORK_COMMAND_BITS ; i++ )</span>
<span class="lineNum">     395 </span>                :     {
<span class="lineNum">     396 </span><span class="lineCov">         459249 :         bool bit = (bool)((req-&gt;cmdType &gt;&gt; i) &amp; 0x1);</span>
<span class="lineNum">     397 </span><span class="lineCov">         459249 :         hlp-&gt;data.push_back(bit);</span>
<span class="lineNum">     398 </span>                :     }
<span class="lineNum">     399 </span><span class="lineCov">        1071581 :     for ( uint i=0 ; i &lt; NETWORK_THREADID_BITS ; i++ )</span>
<span class="lineNum">     400 </span>                :     {
<span class="lineNum">     401 </span><span class="lineCov">         918498 :         bool bit = (bool)((req-&gt;threadId &gt;&gt; i) &amp; 0x1);</span>
<span class="lineNum">     402 </span><span class="lineCov">         918498 :         hlp-&gt;data.push_back(bit);</span>
<span class="lineNum">     403 </span>                :     }
<span class="lineNum">     404 </span><span class="lineCov">         153083 :     if (req-&gt;cmdType == CACHE_WRITEBACK)</span>
<span class="lineNum">     405 </span><span class="lineCov">         918778 :     {   for ( uint i = hlp-&gt;data.size() ; i &lt; 1*max_phy_link_bits; i++ )</span>
<span class="lineNum">     406 </span>                :         {
<span class="lineNum">     407 </span><span class="lineCov">         910310 :             hlp-&gt;data.push_back(true);</span>
<span class="lineNum">     408 </span>                :         }
<span class="lineNum">     409 </span><span class="lineCov">           4234 :         hlp-&gt;msg_class = RESPONSE_PKT;</span>
<span class="lineNum">     410 </span>                :     }
<span class="lineNum">     411 </span>                :     else
<span class="lineNum">     412 </span><span class="lineCov">         148849 :         hlp-&gt;msg_class = ONE_FLIT_REQ;</span>
<span class="lineNum">     413 </span>                : 
<span class="lineNum">     414 </span>                : 
<span class="lineNum">     415 </span><span class="lineCov">         306166 :     hlp-&gt;data_payload_length = ceil(hlp-&gt;data.size() *1.0 / max_phy_link_bits);   </span>
<span class="lineNum">     416 </span><span class="lineCov">         153083 :     hlp-&gt;data_payload_length = hlp-&gt;data_payload_length * max_phy_link_bits;</span>
<span class="lineNum">     417 </span><span class="lineCov">         153083 :     hlp-&gt;sent_time = req-&gt;arrivalTime;</span>
<span class="lineNum">     418 </span><span class="lineCov">       32308701 :     for ( uint i=hlp-&gt;data.size() ; i &lt; hlp-&gt;data_payload_length; i++ )</span>
<span class="lineNum">     419 </span><span class="lineCov">       32002535 :         hlp-&gt;data.push_back(false);</span>
<span class="lineNum">     420 </span>                : 
<span class="lineNum">     421 </span><span class="lineCov">         153083 : }</span>
<span class="lineNum">     422 </span>                : 
<span class="lineNum">     423 </span>                : void 
<span class="lineNum">     424 </span><span class="lineCov">         148647 : GenericTPG::convertFromBitStream(Request* req, HighLevelPacket *hlp)</span>
<span class="lineNum">     425 </span>                : {
<span class="lineNum">     426 </span><span class="lineCov">         148647 :     req-&gt;address = 0;        </span>
<span class="lineNum">     427 </span><span class="lineCov">        4905351 :     for (unsigned int i=0; i &lt; NETWORK_ADDRESS_BITS; i++)</span>
<span class="lineNum">     428 </span>                :     {
<span class="lineNum">     429 </span><span class="lineCov">        9513408 :         req-&gt;address = req-&gt;address | (hlp-&gt;data[i] &lt;&lt; i);</span>
<span class="lineNum">     430 </span>                :     }
<span class="lineNum">     431 </span>                : /*    unsigned int temp = 0;
<span class="lineNum">     432 </span>                :     for (unsigned int i = 0; i &lt; NETWORK_COMMAND_BITS; i++)
<span class="lineNum">     433 </span>                :     {
<span class="lineNum">     434 </span>                :         temp = temp | (hlp-&gt;data[i+NETWORK_ADDRESS_BITS] &lt;&lt; i);
<span class="lineNum">     435 </span>                :     }
<span class="lineNum">     436 </span>                :     req-&gt;cmdType = (Command_t)temp;
<span class="lineNum">     437 </span>                : 
<span class="lineNum">     438 </span>                :     req-&gt;threadId = 0;
<span class="lineNum">     439 </span>                :     for (unsigned int i=0; i &lt; NETWORK_THREADID_BITS; i++)
<span class="lineNum">     440 </span>                :     {
<span class="lineNum">     441 </span>                :         req-&gt;threadId = req-&gt;threadId | (hlp-&gt;data[i+NETWORK_ADDRESS_BITS+NETWORK_COMMAND_BITS] &lt;&lt; i);
<span class="lineNum">     442 </span>                :     }
<span class="lineNum">     443 </span>                : */ /*   req-&gt;data.value = 0;
<span class="lineNum">     444 </span>                :     if (req-&gt;cmdType == CACHE_READ || req-&gt;cmdType == CACHE_WRITE || req-&gt;cmdType == CACHE_PREFETCH)
<span class="lineNum">     445 </span>                :         for ( uint i=0 ; i &lt; 1*max_phy_link_bits; i++ )
<span class="lineNum">     446 </span>                :         {
<span class="lineNum">     447 </span>                :             req-&gt;data.value = req-&gt;data.value | (hlp-&gt;data[i+NETWORK_ADDRESS_BITS] &lt;&lt; i);
<span class="lineNum">     448 </span>                :             req-&gt;data.size = CACHE_BLOCK_SIZE;
<span class="lineNum">     449 </span>                :         }
<span class="lineNum">     450 </span>                : */
<span class="lineNum">     451 </span><span class="lineCov">         148647 : }</span>
<span class="lineNum">     452 </span>                : 
<span class="lineNum">     453 </span>                : 
<span class="lineNum">     454 </span>                : short int 
<span class="lineNum">     455 </span><span class="lineCov">         153083 : GenericTPG::map_addr(unsigned long long int *addr)</span>
<span class="lineNum">     456 </span>                : {
<span class="lineNum">     457 </span><span class="lineCov">         153083 :     unsigned int temp = MC_ADDR_BITS;   </span>
<span class="lineNum">     458 </span><span class="lineCov">         153083 :     unsigned int temp2 = temp-(int)log2(no_mcs);   </span>
<span class="lineNum">     459 </span><span class="lineCov">         153083 :     unsigned int lower_mask = pow(2.0,temp2*1.0)-1;</span>
<span class="lineNum">     460 </span><span class="lineCov">         153083 :     unsigned long long int upper_mask = (0xFFFFFFFFFFFF)-(pow(2.0,temp*1.0)-1);</span>
<span class="lineNum">     461 </span><span class="lineCov">         153083 :     unsigned int lower_addr = (*addr) &amp; lower_mask;</span>
<span class="lineNum">     462 </span><span class="lineCov">         153083 :     unsigned long long int upper_addr = ((*addr) &amp; upper_mask) &gt;&gt; (int)log2(no_mcs);</span>
<span class="lineNum">     463 </span><span class="lineCov">         153083 :     short int mc_addr = ((*addr) &gt;&gt; temp2) &amp; (no_mcs-1);</span>
<span class="lineNum">     464 </span>                :     //cout &lt;&lt; hex &lt;&lt; temp2 &lt;&lt; &quot; &quot; &lt;&lt; (*addr) &lt;&lt; &quot; &quot; &lt;&lt; upper_addr &lt;&lt; &quot; &quot; &lt;&lt; lower_addr &lt;&lt; &quot; &quot;;
<span class="lineNum">     465 </span><span class="lineCov">         153083 :     *addr = upper_addr | lower_addr;</span>
<span class="lineNum">     466 </span>                :     //cout &lt;&lt; (*addr) &lt;&lt; &quot; &quot; &lt;&lt; mc_addr &lt;&lt; endl;     
<span class="lineNum">     467 </span><span class="lineCov">         153083 :     return mc_addr;</span>
<span class="lineNum">     468 </span>                : }
<span class="lineNum">     469 </span>                : 
<span class="lineNum">     470 </span>                : 
<span class="lineNum">     471 </span>                : 
<span class="lineNum">     472 </span>                : 
<span class="lineNum">     473 </span>                : string
<span class="lineNum">     474 </span><span class="lineCov">             56 : GenericTPG::toString () const</span>
<span class="lineNum">     475 </span>                : {
<span class="lineNum">     476 </span><span class="lineCov">             56 :     stringstream str;</span>
<span class="lineNum">     477 </span>                :     str &lt;&lt; &quot;\nGenericTPG: &quot;
<span class="lineNum">     478 </span>                :         &lt;&lt; &quot;\t trace: &quot; &lt;&lt; trace_name
<span class="lineNum">     479 </span>                :         &lt;&lt; &quot;\t vcs: &quot; &lt;&lt; ready.size()
<span class="lineNum">     480 </span>                :         &lt;&lt; &quot;\t address: &quot; &lt;&lt;address
<span class="lineNum">     481 </span>                :         &lt;&lt; &quot;\t node_ip: &quot; &lt;&lt; node_ip
<span class="lineNum">     482 </span><span class="lineCov">            224 :         ;</span>
<span class="lineNum">     483 </span><span class="lineCov">             56 :     return str.str();</span>
<span class="lineNum">     484 </span>                : } /* ----- end of function GenericTPG::toString ----- */
<span class="lineNum">     485 </span>                : 
<span class="lineNum">     486 </span>                : string
<span class="lineNum">     487 </span><span class="lineCov">             56 : GenericTPG::print_stats() const</span>
<span class="lineNum">     488 </span>                : {
<span class="lineNum">     489 </span><span class="lineCov">             56 :     stringstream str;</span>
<span class="lineNum">     490 </span>                :     str &lt;&lt; &quot;\nTPG: &quot; &lt;&lt; address
<span class="lineNum">     491 </span>                :         &lt;&lt; &quot;\nTPG [&quot; &lt;&lt; node_ip &lt;&lt; &quot;] packets_out:\t &quot; &lt;&lt; packets
<span class="lineNum">     492 </span>                :         &lt;&lt; &quot;\nTPG [&quot; &lt;&lt; node_ip &lt;&lt; &quot;] Avg fwd_path_delay:\t &quot; &lt;&lt; (fwd_path_delay+0.0)/packets
<span class="lineNum">     493 </span>                :         &lt;&lt; &quot;\nTPG [&quot; &lt;&lt; node_ip &lt;&lt; &quot;] min_pkt_latency:\t &quot; &lt;&lt; min_pkt_latency
<span class="lineNum">     494 </span>                :         &lt;&lt; &quot;\nTPG [&quot; &lt;&lt; node_ip &lt;&lt; &quot;] last_packet_out_cycle:\t &quot; &lt;&lt; last_packet_out_cycle
<span class="lineNum">     495 </span>                :         &lt;&lt; &quot;\nTPG [&quot; &lt;&lt; node_ip &lt;&lt; &quot;] packet_in\t &quot; &lt;&lt; packets_in
<span class="lineNum">     496 </span>                :         &lt;&lt; &quot;\nTPG [&quot; &lt;&lt; node_ip &lt;&lt; &quot;] Avg round trip latency:\t &quot; &lt;&lt; (roundTripLat+0.0)/packets_in
<span class="lineNum">     497 </span><span class="lineCov">            840 :         &lt;&lt; &quot;\nTPG [&quot; &lt;&lt; node_ip &lt;&lt; &quot;] Total Unsink\t &quot; &lt;&lt; mshrHandler-&gt;unsink;</span>
<span class="lineNum">     498 </span>                :         ;
<span class="lineNum">     499 </span><span class="lineCov">             56 :     return str.str();</span>
<span class="lineNum">     500 </span><span class="lineCov">              2 : } /* ----- end of function GenericTPG::toString ----- */</span>
<span class="lineNum">     501 </span>                : 
<span class="lineNum">     502 </span>                : #endif /* ----- #ifndef _generictpg_cc_INC ----- */
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
  <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
  <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LTP GCOV extension version 1.6</a></td></tr>
  </table>
  <br>

</body>
</html>
